package com.test.hello.common;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

/**
 * 
 *  拦截器.
 *
 */
public class SessionHandlerInterceptor extends HandlerInterceptorAdapter {

	private static final Logger logger = Logger.getLogger(SessionHandlerInterceptor.class);
	
	@Override
	public void afterCompletion(HttpServletRequest request,
			HttpServletResponse response, Object handler, Exception ex)
			throws Exception {
		
		//super.afterCompletion(request, response, handler, ex);
		logger.info("afterCompletion.....");
	}

	@Override
	public void postHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler,
			ModelAndView modelAndView) throws Exception {
		
		//super.postHandle(request, response, handler, modelAndView);
		logger.info("postHandle.....");
	}

	@Override
	public boolean preHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler) throws Exception {
		
		//return super.preHandle(request, response, handler);
		logger.info("preHandle.....");
		return true;
	}

	
	
}
